(** 
    Link.ml

    Bozman Çagdas <bozman.cagdas@gmail.com> - 2011
    Razakamiadana Tefin <tefy.razaka@gmail.com>   - 2011
*)
open Utils

let compare link_req link =
  let l1 = String.capitalize link_req 
  and l2 = String.uncapitalize link_req in
    if (l1 = link) || (l2 = link) then true
    else 
      let reg_link = Str.regexp "fr:\\(.*\\)" in
	if Str.string_match reg_link link_req 0 then 
	  let l1 = String.capitalize (from_group link_req 1)
	  and l2 = String.uncapitalize (from_group link_req 1)
	  in (l1 = link) || (l2 == link)
	else  if Str.string_match reg_link link 0
	then 
	  let l1 = String.capitalize (from_group link 1)
	  and l2 = String.uncapitalize (from_group link 1)
	  in (l1 = link_req) || (l2 == link_req)
	else false
	  
